package jp.sourceforge.akjrcp.potrace;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;

public class PotraceSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String EXPORT_POTRACE_SETTINGS="potracesetting.potrace_settings";
	public static final String EXPORT_POTRACE_SETTINGS_INDEX="potracesetting.potrace_settings_index";
	public static final String POTRACE_PAHT="potracesetting.potrace_path";
	public static final String MKBITMAP_PAHT="potracesetting.mkbitmpap_path";
	public PotraceSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("potracesetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		//addField(new GenericParametersEditor(EXPORT_POTRACE_SETTINGS,Messages.getString("potracesetting.potrace_settings"),getFieldEditorParent()));
		FileFieldEditor fileField=new FileFieldEditor(
				POTRACE_PAHT, Messages.getString("potracesetting.potrace_path"),getFieldEditorParent()); //$NON-NLS-1$
        fileField.setFileExtensions(new String[]{"potrace.exe"}); //$NON-NLS-1$
        addField(fileField);
        
        FileFieldEditor fileField2=new FileFieldEditor(
        		MKBITMAP_PAHT, Messages.getString("potracesetting.mkbitmap_path"),getFieldEditorParent()); //$NON-NLS-1$
        fileField2.setFileExtensions(new String[]{"mkbitmap.exe"}); //$NON-NLS-1$
        addField(fileField2);
	}

	public void init(IWorkbench workbench) {
		
	}

}
